package com.maxd.respository.selfActivity;

import com.maxd.model.SelfActivity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SelfActivityRepository extends Repository<SelfActivity, Long> {
    @Query(value = "from SelfActivity s where s.state=:state")
    List<SelfActivity> findOne(@Param("state") String state);

    @Query(value = "from SelfActivity s where s.title=:title")
    SelfActivity findByTitle(String title);

    @Query(value = "select * from self_activity where state != 20 ",nativeQuery = true)
    List<SelfActivity> adminList();

}